<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="../Admin/role/css/index.css">
<script type="text/javascript" src="../Admin/role/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="../Admin/role/js/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(function() {
	$("#projectid").change(
	function() {	
		var projectid = $("#projectid").val();		
		$.ajax({
			url : "../xiaoshoujihui/selectAllComplex.action",
			type : "POST",
			dataType : "json",
			data : {
				"projectid" : projectid
			},
		success : function(data) { 
			$('#complexid').empty();
			$('#complexid').append("<option>------请选择楼栋--------</option>");
			jQuery.each(data.complexList, function(i,item){ 
			$('#complexid').append("<option value="+ item.id+">"+ item.cnumber+"</option>");
			  }); 
	            },
	        });
	    });
	
	$("#complexid").change(
			function() {	
				var complexid = $("#complexid").val();
				$.ajax({
					url : "../xiaoshoujihui/selectAllUnit.action",
					type : "POST",
					dataType : "json",
					data : {
						"complexid" : complexid
					},
				success : function(data) {
					$('#unitid').empty();
					$('#unitid').append("<option>------请选择单元--------</option>");
					jQuery.each(data.unitList, function(i,item){ 
					$('#unitid').append("<option value="+ item.id+">"+ item.unumber+"</option>");
					  }); 
			            },
			        });
			    });
	
	$("#unitid").change(
			function() {	
				var unitid = $("#unitid").val();				
				$.ajax({
					url : "../xiaoshoujihui/selectAllroom.action?unitId="+unitid,
					type : "POST",
					dataType : "json",
					data : {
						"unitid" : unitid
					},
				success : function(data) { 				
					$('#roomid').empty();
					$('#roomid').append("<option>------请选择单元--------</option>");
					jQuery.each(data.roomList, function(i,item){ 
					$('#roomid').append("<option value="+ item.id+">"+ item.number+"</option>");
					  }); 
			            },
			        });
			    });	
	

});
	
</script>
<script type="text/javascript" src="${pageContext.request.contextPath}/Admin/second/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/Admin/second/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/Admin/second/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath}/Admin/second/jquery.validation/1.14.0/jquery.validate.min.js"></script> 
</head>
<body class="mian_bj">
<div class="mian_top_01">
<div class="mian_top_r"></div>
<div class="mian_top_l"></div>
<div class="mian_top_c">
</div>
<form action="../xiaoshoujihui/QuerenAddXiaoShouJiHui.action" method="post">

	  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="mian_b_bg_xz">
	  
	  	<tr>
			<td width="5%" class="mian_b_bg_lm">&nbsp;</td>
			<td colspan="3" class="mian_b_bg_lm">添加销售机会</td>
		</tr>
	  	<tr style="height: 50px">
	  		<td width="7%" valign="top">接待时间:</td>
	  		<td class="ybox04tdr"><input type="text" id="time11111" name="receivetime" onfocus="WdatePicker({maxDate:'%y-%M-%d'})"  class="input-text Wdate" style="width:120px;" /></td>
	  	</tr>
	  	<tr style="height: 50px">
			<td width="7%" valign="top">接待方式:</td>
			<td><input name="receivetype" type="text"></input></td>
		</tr>
		<tr style="height: 50px">
			<td width="7%" valign="top">接待内容:</td>
			<td><input name="receivecontent" type="text"></input></td>
		</tr>
    	<tr style="height: 50px">
    		<td>意向项目：</td>
    		<td>
    		<select name="projectname" id="projectid" ">
	    		<option >请选择</option>   		
				<c:forEach items="${projectList}" var="project">
					<option value="${project.id}" >${project.name}</option>
				</c:forEach>
			</select></td>
    	</tr>
    	<tr style="height: 50px">
    		<td>意向楼栋：</td>
    		
    		<td><select name="complex" id="complexid"  >
    		<option >请选择</option>
			<c:forEach items="${complexList}" var="complex">
				<option value="${complex.cnumber}">${complex.cnumber}</option>
			</c:forEach> 
		</select></td>
    	</tr>
    	<tr style="height: 50px">
    		<td>意向单元：</td>
    		<td>
    		<select name="unitid" id="unitid" >
    		<option >请选择</option>
			<c:forEach items="${unitList}" var="unit">
				<option value="${unit.unumber}">${unit.unumber}</option>
			</c:forEach>
		</select> </td>
    	</tr>
    	<tr style="height: 45px">
    		<td>意向房间：</td>
    		<td>
	    		<select name="roomid" id="roomid">
	    		<option >请选择</option>
				<c:forEach items="${roomList}" var="room">
					<option value="${room.number}">${room.number}</option>
				</c:forEach>
				</select>
			</td>
    	</tr>
    	<tr style="height: 45px">
    		<td>客户名称：</td>
    		<td>
    		<select name="clientname" id="id">
	    		<option >请选择</option>
				<c:forEach items="${clientList}" var="client">
					<option value="${client.clientidname}">${client.clientidname}</option>
				</c:forEach>
				</select> 
    		<%-- <input id="2" type="text" name="clientname" value="${clientList.clientidname}" readonly="readonly"/>  --%>
    		</td>
    	</tr>
    	<tr style="height: 50px">
    		<td>客户电话：</td>
    		<td>
	    		<select id="phone" name="phone" ">
				<option >请选择</option>
				<c:forEach items="${clientList}" var="client">
					<option id="1" value="${client.phone}">${client.phone}</option>
				</c:forEach>
			   </select> 
		   </td>
    	</tr>
    	
    	<tr style="height: 45px">
    		<td>客户ID：</td>
    		<td>
    		<select id="clientid" name="clientid" >
				<option >请选择</option>
				<c:forEach items="${clientList}" var="client">
					<option id="1" value="${client.id}">${client.id}</option>
				</c:forEach>
			   </select> 
<%--     		 <input id="5" type="text" name="clientid" value="${clientList.id }" readonly="readonly"/>  --%>
    		</td>
    	</tr>
    	<tr style="height: 45px">
    		<td>业务员ID：</td>
    		<td><input id="4" type="text" name="userid" readonly="readonly" value="1"/></td>
    	</tr>    
    	<tr style="height: 45px">
    		<td>业务员名称：</td>
    		<td><input id="3" type="text" name="username" readonly="readonly" value="admin"/></td>
    	</tr>    	
    	<tr style="height: 45px">
    		<td>接待信息：</td>
    		<td><input type="text" name="describe1" width="800px" height="300px"/></td>
    	</tr>
    	<tr style="height: 50px" align="center">
    		<td colspan="2"><input type="submit" value="提交" style="width: 70px;height: 27px;color: white;background-color: orange" /></td>    		
    	</tr>
    </table>
		<%--意向项目<select name="projectname">
			<c:forEach items="${allprojectnameList}" var="project">
				<option value="${project.pname}">${project.pname}</option>
			</c:forEach>
		</select>
		意向房间<select name="roomid">
			<c:forEach items="${allroomnumberList}" var="room">
				<option value="${room.rnumber}">${room.rnumber}</option>
			</c:forEach>
			</select>
		意向单元<select name="unitid">
			<c:forEach items="${allunitnumberList}" var="unit">
				<option value="${unit.unumber}">${unit.unumber}</option>
			</c:forEach>
		</select>
		意向楼栋<select name="complex">
			<c:forEach items="${allcnumberList}" var="complex">
				<option value="${complex.cnumber}">${complex.cnumber}</option>
			</c:forEach>
		</select><br/>
		客户电话:
		<select id="1" name="phone">
			<option>请选择</option>
			<c:forEach items="${allClientphoneList}" var="client">
				<option id="1" value="${client.phone}">${client.phone}</option>
			</c:forEach>
		</select>
		客户名称:<input id="2" type="text" name="clientname" readonly="readonly"/>
		客户ID:<input id="5" type="text" name="clientid" readonly="readonly"/>
		业务员名称:<input id="3" type="text" name="username" readonly="readonly" value="admin"/>
		业务员ID:<input id="4" type="text" name="userid" readonly="readonly" value="1"/><br/>
		接待信息:<input type="text" name="describe1" width="800px" height="300px"/>
		<input type="submit" value="提交"/> --%>
	</form>
</div>
</body>
</html>